<%@ page language="java" pageEncoding="UTF-8" import="com.chinapost.util.AuthUtil"%>
<%@ taglib prefix="my" uri="/WEB-INF/tlds/permission.tld" %>
<%
	AuthUtil authUtil = new AuthUtil(session);
%>
<script type="text/javascript">
var ycsj_datagrid;
$(function ()
{
    ycsj_datagrid = $('#ycsj_manager_datagrid').datagrid(
        {
            url : '${pageContext.request.contextPath}/ycsjAction!datagrid.action',
            queryParams :{cbh:'${sessionInfo.bh}'},
            pagination : true,
            pageSize : 20,
            pageList :  [  10, 20, 30, 40, 50 ],
            border : false,
            fit: true,
            fitColumns: true,
            idField : 'cid',
            sortName : 'cbh',
            sortOrder : 'asc',
            checkOnSelect : false,
            selectOnCheck : true,
            columns : [[
                    {
                        title : 'id',
                        field : 'cid',
                        width : 100,
                        align : "center",
                        checkbox:true
                    },
                    {
                        title : '部门名称',
                        field : 'deptname',
                        align : "center",
                        width : 120
                    },
                    {
                        title : '用户编号',
                        field : 'cbh',
                        align : "center",
                        width : 80
                    },
                    {
                        title : '用户名',
                        field : 'username',
                        align : "center",
                        width : 80
                    },
                    {
                        title : '月份',
                        field : 'csbyf',
                        align : "center",
                        width : 60
                    },
                    {
                        title : '业务类别',
                        field : 'kindname',
                        align : "center",
                        width : 80
                    },
                    {
                        title : '账号',
                        field : 'czh',
                        align : "center",
                        width : 100
                    },
                    {
                        title : '开户局',
                        field : 'ckhj',
                        align : "center",
                        width : 70
                    },
                    {
                        title : '账户余额',
                        field : 'cye',
                        align : "center",
                        width : 80
                    },
                    {
                        title : '存期',
                        field : 'ccq',
                        align : "center",
                        width : 50
                    },
                    {
                        title : '异常原因',
                        field : 'cyy',
                        align : "center",
                        width : 200
                    }
                ]]
        }
        );
}
);


function _searchYcsj() {
	ycsj_datagrid.datagrid('load', sy.serializeObject($('#ycsj_search_form')));
	ycsj_datagrid.datagrid('uncheckAll').datagrid('unselectAll').datagrid('clearSelections');
};


function export_ycsj() {
	var smonth=$('#ycsj_startMonth').val();
	var emonth=$('#ycsj_endMonth').val();
	if (smonth.length >0 && emonth.length >0){
	 url='${pageContext.request.contextPath}/ycsjAction!exportExcel.action';
	 $('#ycsj_search_form').attr('action',url);
     $('#ycsj_search_form').submit();
	}else{
		parent.sy.messagerAlert('提示', '请选择要导出数据的起始月份和结束月份！', 'error');
	}
}
</script>

<div class="easyui-layout" data-options="fit:true" style="overflow: hidden;">
	<div data-options="region:'north',title:'查询',iconCls:'icon-search'" style="height: 80px;padding:5px;overflow: hidden;">
		<div style="padding:5px">
			<form method="post" id="ycsj_search_form" style="display:inline">
			<input type="hidden"  name="deptid" value="${sessionInfo.deptid}"/>
			<input type="hidden"  name='cbh' value="${sessionInfo.bh}"/>
			<span>账号：</span>
			<input type='text' name='czh'  style="width:80px"/>&nbsp;
			<span>开始月份：</span>
			<input class="easyui-my97" type="text" id="ycsj_startMonth" name="startMonth"  data-options="dateFmt:'yyyyMM'" style="width:80px"/>&nbsp;
			<span>结束月份：</span>
			<input class="easyui-my97" type="text" id="ycsj_endMonth" name="endMonth"  data-options="dateFmt:'yyyyMM'" style="width:80px"/>&nbsp;
			</form>
			<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="_searchYcsj();">查询</a>
			<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-excel'" onClick="export_ycsj();;">导出</a>
		</div>
	</div>
	<div data-options="region:'center',title:'异常数据列表',border:true,iconCls:'icon-menu'" style="overflow: hidden;">
		<table id="ycsj_manager_datagrid"></table>
	</div>
</div>
